<!--加载全局布局文件-->
<% layout('layout')%>

<!--在这里编写你的代码-->
<!--搜索框-->

<div class="am-g am-margin-top ng-cloak" ng-controller="ClassifyCtrl" ng-cloak>
    <div class="am-u-lg-6">
        <div class="am-input-group am-input-group-primary am-radius">
            <input type="text" class="am-form-field" placeholder="请输入商品名称" ng-model="name" style="height:37px;">
            <span class="am-input-group-btn">
                <a ng-click="searchPro()">
                    <button class="am-btn am-btn-primary" type="button"><span class="am-icon-search"></span></button>
                </a>
            </span>
        </div>
    </div>
</div>

<div class="am-g">
    <div class="am-u-sm-6 am-padding-left-sm am-padding-right-sm text-center am-margin-top-xs">
        <a href="/classify/productsLimit" class="am-btn am-btn-success scor-width-90-per
        am-radius am-animation-fade">全部</a>
    </div>

    <% classifys.forEach(function(c){ %>
    <div class="am-u-sm-6 am-padding-left-sm am-padding-right-sm text-center am-margin-top-xs">
        <a href="/classify/proListById/<%= c.id%>" class="am-btn am-btn-success scor-width-90-per
        am-radius am-animation-fade"><%= c.get('title')%></a>
    </div>
    <%});%>
</div>

<div data-am-widget="list_news" class="am-list-news am-list-news-default app-bg-white am-margin-0 am-padding-xs ng-cloak" ng-controller="ClassifyCtrl" ng-cloak>
    <!--列表标题-->
    <div class="am-list-news-hd am-cf">
        <h2>热销商品</h2>
    </div>

    <div class="am-list-news-bd">
        <ul class="am-list">
            <% products.forEach(function(p){ %>
            <li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left app-relative">
                <a ng-href="/detail/<%= p.id %>" class="am-block" >
                    <div class="am-u-sm-5">
                        <img src="<%= JSON.parse(p.get('picurlarray'))[0] %>" width="100%" height="100%" class="am-radius"/>
                    </div>
                    <div class="am-u-sm-7 am-list-main">
                        <h3 class="am-list-item-hd"><%= p.get('name') %></h3>
                        <span class="am-badge am-badge-primary am-radius"><i class="am-icon-tag"></i> <%= p.get('minSpecName') %></span>
                        <div class="am-list-item-text line-clamp"><%= p.get('intro') %></div>
                        <div class="am-text-default am-text-danger">￥<%= p.get('minPrice') %></div>
                        <div class="am-text-xs app-color-gray"><%= p.get('commentCount') %>人已评</div>

                    </div>
                </a>
                <% if(p.get('name').indexOf('预售') < 0){%>
                <button class="app-lsit-cart" ng-click='addToCart("<%= p.id%>","<%= p.get('minSpec')%>",1,"<%= p.get('name') %>")'></button>
                <% }%>
            </li>

            <% });%>
        </ul>
    </div>
</div>

<% include ../navbar.ejs %>
<% block('footer').append('<script src="'+CDN+'script/classify.js"></script>') %>











